function ajax(url, type,data, datatype,fun) {
    $.ajax({
        url: url,
        type: type,
        data: data,
        dataType: datatype,
        async: false,
        headers: {
            "token": localStorage.getItem("token")
        },
        success: fun
    });
}